import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import { SelectivePreloadingStrategyService } from "./core/route/selective-preloading-strategy.service";

const routes: Routes = [
  // { path: "", pathMatch: "full", redirectTo: "authority" },
  {
    path: "",
    loadChildren: () =>
      import("./view-model/home/home.module").then(m => m.HomeModule),
    data: { preload: false }
  },
  {
    path: "home",
    loadChildren: () =>
      import("./view-model/home/home.module").then(m => m.HomeModule),
    data: { preload: false }
  },
  {
    path: "login",
    loadChildren: () =>
      import("./view-model/login/login.module").then(m => m.LoginModule),
    data: { preload: false }
  },
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, {
      useHash: true,
      enableTracing: false,
      preloadingStrategy: SelectivePreloadingStrategyService
    })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule {}
